import HttpRequest from '@/api/request';
import ApiConfig from '@/api/api-config';

function getUserList(option) {//用户列表
    let url = ApiConfig.getUserList;
    return HttpRequest.requestJsonPost(url,option)
}

function getRoleSelectData(option) {//角色下拉框
    let url = ApiConfig.roleSelect;
    return HttpRequest.requestJsonPost(url,option)
}

function getUserById(option) {//获取用户信息
    let url = ApiConfig.getUserById;
    return HttpRequest.requestJsonPost(url,option)
}

function updateUserRole(option) {//修改用戶角色
    let url = ApiConfig.updateUserRole;
    return HttpRequest.requestJsonPost(url,option)
}

function getAllFondsTreeData(option) {//获取全集全宗树（全量数据）
    let url = ApiConfig.getAllFondsTreeData;
    return HttpRequest.requestJsonPost(url,option)
}

// 获取所属分区下拉选数据
function getKeyName(option) {//根据全宗名获取全宗联想
    let url = ApiConfig.getKeyNameUrl;
    return HttpRequest.requestJsonPost(url,option)
}

// 添加用户 new
function saveSystemUser(option) {
    let url = ApiConfig.saveSystemUser;
    return HttpRequest.requestJsonPost(url,option)
}

// 获取证件类型 new
function getCredentialsTypeCandidates(option) {
    let url = ApiConfig.getCredentialsTypeCandidates;
    return HttpRequest.requestJsonPost(url,option)
}

//取用户相关全宗树
function getTree(params){
    let url = ApiConfig.getTree;
    return HttpRequest.requestJsonPost(url,params)
}
// 删除用户
function userInfoGetTree(params){
    let url = ApiConfig.userInfoGetTree;
    return HttpRequest.requestJsonPost(url,params)
}
// 用户启用禁用
function disabled(params){
    let url = ApiConfig.disabled;
    return HttpRequest.requestJsonPost(url,params)
}
function holderList() {
    let url = ApiConfig.holderList;
    return HttpRequest.requestJsonPost(url)
}
function creationAdmin(params) {
    let url = ApiConfig.creationAdmin;
    return HttpRequest.requestJsonPost(url,params)
}
function bindCinemaList(params) {
    let url = ApiConfig.bindCinemaList;
    return HttpRequest.requestJsonPost(url,params)
}
function cinemaPage(params) {
    let url = ApiConfig.cinemaPage;
    return HttpRequest.requestJsonPost(url,params)
}
function headquartersPage(params) {
    let url = ApiConfig.headquartersPage;
    return HttpRequest.requestJsonPost(url,params)
}
function analysisExcel(params) {
    let url = ApiConfig.analysisExcel;
    return HttpRequest.upLoadFormPost(url,params)
}
function downloadExcel() {
    let url = ApiConfig.downloadExcel;
    return HttpRequest.requestBlobGetFile(url)
}
function noBindCinemaList(params) {
    let url = ApiConfig.noBindCinemaList;
    return HttpRequest.requestJsonPost(url,params)
}
function bindCinema(params) {
    let url = ApiConfig.bindCinema;
    return HttpRequest.requestJsonPost(url,params)
}
function cancelBind(params) {
    let url = ApiConfig.cancelBind;
    return HttpRequest.requestJsonPost(url,params)
}
function updateInfo(params) {
    let url = ApiConfig.updateInfo;
    return HttpRequest.requestJsonPost(url,params)
}
function resetPwd(params) {
    let url = ApiConfig.resetPwd;
    return HttpRequest.requestJsonPost(url,params)
}
let Service = {
    getUserList,
    getRoleSelectData,
    getUserById,
    updateUserRole,
    getAllFondsTreeData,
    getKeyName,
    saveSystemUser, // 添加用户 new
    getCredentialsTypeCandidates,
    getTree,
    userInfoGetTree,
    disabled, //用户启用禁用
    holderList,
    creationAdmin,
    bindCinemaList,
    cinemaPage,
    headquartersPage,
    analysisExcel,
    downloadExcel,
    noBindCinemaList,
    bindCinema,
    cancelBind,
    updateInfo,
    resetPwd
};

export default Service;